
import actions from './actions'
import mutations from './mutations'
import _ from "lodash";

var global = {
    // @ts-ignore
    // strict: process.env.NODE_ENV !== 'production',
    strict: false,
    userInfo: {},
    state: {
        allTips: {},
        messageNumber: {},
        sysTime: ''
    },

    getters: {
        getAllTips(state: any) {
            return state.allTips
        },
        getMessageNumber(state: any) {
            return state.messageNumber
        },
        getSysTime(state: any) {
            return state.sysTime
        },
        // 获取用户信息流程待梳理
        userInfo(state: any) {
            if (!_.isEmpty(state.userInfo)) {
                return state.userInfo;
            }
            let userinfo = localStorage.getItem('userInfo');
            return userinfo && JSON.parse(userinfo) || '';
        },
    },
    mutations,
    actions
}

export default global